<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <link rel="stylesheet" href="../../css/main.css">
    <link rel="stylesheet" href="../../css/searchCountUp.css">
    <title>产值计算表</title>
</head>
<body>
<form class="top layui-form">
    <div class="layui-form-item">
        <button type="button" onclick="exports()" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe621;</i>导出</button>
    </div>
</form>
<div id="searchCountUp">
    <div class="tabs">
        <table width="100%" id="searchCU" border="1px" cellpadding="0" bordercolor="#c2c2c2" style="border-collapse:collapse;">
            <tr style="font-weight: bold">
                <td rowspan="2">工料机分类</td>
                <td rowspan="2">编号</td>
                <td rowspan="2">名称</td>
                <td>操作</td>
                <td colspan="3">工料机表</td>
                <td colspan="3">合同计价<br>产值</td>
                <td colspan="3">合同计量<br>产值</td>
                <td colspan="3">安全文明措施费<br>产值</td>
            </tr>
            <tr>
                <td></td>
                <td>数量</td>
                <td>采购价</td>
                <td>合计1</td>
                <td>合同单价</td>
                <td>合计2</td>
                <td>清单编号</td>
                <td>结算计量</td>
                <td>量差</td>
                <td>合计3</td>
                <td>基数</td>
                <td>费率</td>
                <td>合计</td>
            </tr>
            <tr>
                <td v-if="length1 == 1" rowspan="2">直接费-材料费</td>
                <td v-if="length1>1" v-bind:rowspan="length1">直接费-材料费</td>
            </tr>
            <tr v-if="length1 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item1, index) in arrList.zhi_cai" :class="item1.statusr==true ? 'addStyle':''">
                <td>{{item1.t_num}}</td>
                <td>{{item1.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item1.statusr" @click="editor(1, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item1.id, index, 1)">保存</span>
                </td>
                <td v-text="num">{{item1.num}}</td>
                <td>{{item1.tax_money}}</td>
                <td>{{item1.total_money}}</td>
                <td v-bind:contentEditable="item1.statusr" @blur="upd">{{item1.he_price}}</td>
                <td>{{item1.he_total}}</td>
                <td v-bind:contentEditable="item1.statusr" @blur="upd">{{item1.qing_number}}</td>
                <td v-bind:contentEditable="item1.statusr" @blur="upd">{{item1.jie_num}}</td>
                <td>{{item1.jie_num-item1.num}}</td>
                <td>{{item1.he_jietotal}}</td>
                <td v-bind:contentEditable="item1.statusr" @blur="upd">{{item1.an_jishu}}</td>
                <td v-bind:contentEditable="item1.statusr" @blur="upd">{{item1.an_fee}}%</td>
                <td>{{item1.an_total}}</td>
            </tr>
            <tr>
                <td v-if="length2 == 1" rowspan="2">专项措施费-材料</td>
                <td v-if="length2>1" v-bind:rowspan="length2">专项措施费-材料</td>
            </tr>
            <tr v-if="length2 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item2, index) in arrList.zhuan_cai" :class="item2.statusr==true ? 'addStyle':''">
                <td>{{item2.t_num}}</td>
                <td>{{item2.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item2.statusr" @click="editor(2, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item2.id, index, 2)">保存</span>
                </td>
                <td>{{item2.num}}</td>
                <td>{{item2.tax_money}}</td>
                <td>{{item2.total_money}}</td>
                <td v-bind:contentEditable="item2.statusr" @blur="upd">{{item2.he_price}}</td>
                <td>{{item2.he_total}}</td>
                <td v-bind:contentEditable="item2.statusr" @blur="upd">{{item2.qing_number}}</td>
                <td v-bind:contentEditable="item2.statusr" @blur="upd">{{item2.jie_num}}</td>
                <td>{{item2.jie_num-item2.num}}</td>
                <td>{{item2.he_jietotal}}</td>
                <td v-bind:contentEditable="item2.statusr" @blur="upd">{{item2.an_jishu}}</td>
                <td v-bind:contentEditable="item2.statusr" @blur="upd">{{item2.an_fee}}%</td>
                <td>{{item2.an_total}}</td>
            </tr>
            <tr>
                <td colspan="4">合计</td>
                <td></td>
                <td></td>
                <td>{{arrList.cai_heji}}</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td v-if="length3 == 1" rowspan="2">直接费-人工费</td>
                <td v-if="length3>1" v-bind:rowspan="length3">直接费-人工费</td>
            </tr>
            <tr v-if="length3 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item3, index) in arrList.zhi_ren" :class="item3.statusr==true ? 'addStyle':''">
                <td>{{item3.t_num}}</td>
                <td>{{item3.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item3.statusr" @click="editor(3, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item3.id, index, 3)">保存</span>
                </td>
                <td>{{item3.num}}</td>
                <td>{{item3.tax_money}}</td>
                <td>{{item3.total_money}}</td>
                <td v-bind:contentEditable="item3.statusr" @blur="upd">{{item3.he_price}}</td>
                <td>{{item3.he_total}}</td>
                <td v-bind:contentEditable="item3.statusr" @blur="upd">{{item3.qing_number}}</td>
                <td v-bind:contentEditable="item3.statusr" @blur="upd">{{item3.jie_num}}</td>
                <td>{{item3.he_jietotal}}</td>
                <td>{{item3.he_jietotal}}</td>
                <td v-bind:contentEditable="item3.statusr" @blur="upd">{{item3.an_jishu}}</td>
                <td v-bind:contentEditable="item3.statusr" @blur="upd">{{item3.an_fee}}%</td>
                <td>{{item3.an_total}}</td>
            </tr>
            <tr>
                <td v-if="length4 == 1" rowspan="2">专项措施费-人工费</td>
                <td v-if="length4>1" v-bind:rowspan="length4">专项措施费-人工费</td>
            </tr>
            <tr v-if="length4 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item4, index) in arrList.zhuan_ren" :class="item4.statusr==true ? 'addStyle':''">
                <td>{{item4.t_num}}</td>
                <td>{{item4.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item4.statusr" @click="editor(4, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item4.id, index, 4)">保存</span>
                </td>
                <td>{{item4.num}}</td>
                <td>{{item4.tax_money}}</td>
                <td>{{item4.total_money}}</td>
                <td v-bind:contentEditable="item4.statusr" @blur="upd">{{item4.he_price}}</td>
                <td>{{item4.he_total}}</td>
                <td v-bind:contentEditable="item4.statusr" @blur="upd">{{item4.qing_number}}</td>
                <td v-bind:contentEditable="item4.statusr" @blur="upd">{{item4.jie_num}}</td>
                <td>{{item4.he_jietotal}}</td>
                <td>{{item4.he_jietotal}}</td>
                <td v-bind:contentEditable="item4.statusr" @blur="upd">{{item4.an_jishu}}</td>
                <td v-bind:contentEditable="item4.statusr" @blur="upd">{{item4.an_fee}}%</td>
                <td>{{item4.an_total}}</td>
            </tr>
            <tr>
                <td colspan="4">合计</td>
                <td></td>
                <td></td>
                <td>{{arrList.ren_heji}}</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td v-if="length5 == 1" rowspan="2">直接费-机械费</td>
                <td v-if="length5>1" v-bind:rowspan="length5">直接费-机械费</td>
            </tr>
            <tr v-if="length5 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item5, index) in arrList.zhi_jixie" :class="item5.statusr==true ? 'addStyle':''">
                <td>{{item5.t_num}}</td>
                <td>{{item5.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item5.statusr" @click="editor(5, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item5.id, index, 5)">保存</span>
                </td>
                <td>{{item5.num}}</td>
                <td>{{item5.tax_money}}</td>
                <td>{{item5.total_money}}</td>
                <td v-bind:contentEditable="item5.statusr" @blur="upd">{{item5.he_price}}</td>
                <td>{{item5.he_total}}</td>
                <td v-bind:contentEditable="item5.statusr" @blur="upd">{{item5.qing_number}}</td>
                <td v-bind:contentEditable="item5.statusr" @blur="upd">{{item5.jie_num}}</td>
                <td>{{item5.he_jietotal}}</td>
                <td>{{item5.he_jietotal}}</td>
                <td v-bind:contentEditable="item5.statusr" @blur="upd">{{item5.an_jishu}}</td>
                <td v-bind:contentEditable="item5.statusr" @blur="upd">{{item5.an_fee}}%</td>
                <td>{{item5.an_total}}</td>
            </tr>
            <tr>
                <td v-if="length6 == 1" rowspan="2">专项措施费-机械费</td>
                <td v-if="length6>1" v-bind:rowspan="length6">专项措施费-机械费</td>
            </tr>
            <tr v-if="length6 == 1">
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr v-for="(item6, index) in arrList.zhuan_jixie" :class="item6.statusr==true ? 'addStyle':''">
                <td>{{item6.t_num}}</td>
                <td>{{item6.t_name}}</td>
                <td>
                    <span class="operation" v-if="!item6.statusr" @click="editor(6, index)">编辑</span>
                    <span class="operation" v-else @click="saves(item6.id, index, 6)">保存</span>
                </td>
                <td>{{item6.num}}</td>
                <td>{{item6.tax_money}}</td>
                <td>{{item6.total_money}}</td>
                <td v-bind:contentEditable="item6.statusr" @blur="upd">{{item6.he_price}}</td>
                <td>{{item6.he_total}}</td>
                <td v-bind:contentEditable="item6.statusr" @blur="upd">{{item6.qing_number}}</td>
                <td v-bind:contentEditable="item6.statusr" @blur="upd">{{item6.jie_num}}</td>
                <td>{{item6.he_jietotal}}</td>
                <td>{{item6.he_jietotal}}</td>
                <td v-bind:contentEditable="item6.statusr" @blur="upd">{{item6.an_jishu}}</td>
                <td v-bind:contentEditable="item6.statusr" @blur="upd">{{item6.an_fee}}%</td>
                <td>{{item6.an_total}}</td>
            </tr>
            <tr>
                <td colspan="4">合计</td>
                <td></td>
                <td></td>
                <td>{{arrList.jixie_heji}}</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="4">工料机合计</td>
                <td colspan="3">{{arrList.total_gong}}</td>
                <td colspan="3">{{arrList.total_jijia}}</td>
                <td colspan="3">{{arrList.total_jiliang}}</td>
                <td colspan="3">{{arrList.total_anquan}}</td>
            </tr>
        </table>
    </div>
    <div id="demo8"></div>
</div>
</body>
<script type="text/javascript" src="../../js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../layui/layui.all.js"></script>
<script type="text/javascript" src="../../js/vue.js"></script>
<script type="text/javascript" src="../../js/main.js"></script>
<script type="text/javascript" src="../../js/excel.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script>

    var vm = new Vue({
        el: '#searchCountUp',
        data: {
            token: '',
            project_id: sessionStorage.getItem('projectopt'),
            page: 1,
            limit: 12,
            ids:'',
            arrList:[],//数据
            length1:'',
            length2:'',
            length3:'',
            length4:'',
            length5:'',
            length6:'',
            stus: 1,  //判断是否编辑结束
            status: '', // 1: 直接费 2： 专项费
            t_num: '', //操作td下标

            he_price : '', //合同价格
            jie_num: '', //结算计量
            qing_number: '', //清单编号
            an_jishu: '', //基数
            an_fee: '', //费率
            permissions:''

        },
        created: function () {
            this.project_id = sessionStorage.getItem('projectopt');
            this.initData();
        },
        methods: {
            initData:function () {
                var load = layer.load(2, {
                    shade: [0.6, '#fff'] //0.1透明度的白色背景
                })
                var obj = {
                    project_id: this.project_id
                }
                $.when(PUATTRBUTE.REQUESTFUN('api/Statistics/chanzhiindex', obj).done(function(res){
                    layer.close(load);
                    if(res.code == 1){
                        for(item in res.data.zhi_cai){
                            res.data.zhi_cai[item].statusr = false;
                        }
                        for(item in res.data.zhi_jixie){
                            res.data.zhi_jixie[item].statusr = false;
                        }
                        for(item in res.data.zhi_ren){
                            res.data.zhi_ren[item].statusr = false;
                        }
                        for(item in res.data.zhuan_cai){
                            res.data.zhuan_cai[item].statusr = false;
                        }
                        for(item in res.data.zhuan_jixie){
                            res.data.zhuan_jixie[item].statusr = false;
                        }
                        for(item in res.data.zhuan_ren){
                            res.data.zhuan_ren[item].statusr = false;
                        }
                        vm.arrList = res.data;
                        vm.length1 = vm.arrList.zhi_cai.length+1;
                        vm.length5 = vm.arrList.zhi_jixie.length+1;
                        vm.length3 = vm.arrList.zhi_ren.length+1;
                        vm.length2 = vm.arrList.zhuan_cai.length+1;
                        vm.length6 = vm.arrList.zhuan_jixie.length+1;
                        vm.length4 = vm.arrList.zhuan_ren.length+1;
                    }else{
                        if(res.msg == "暂无权限"){
                            vm.permissions= 1 ;
                        }
                        layer.msg(res.msg, {time: 1000, icon:2});
                    }
                }))
            },
            //行编辑
            upd: function (data) {
                var num = data.target.cellIndex;
                this.t_num = data.target.cellIndex;
                if(num == 6){
                    this.he_price = data.target.innerText;
                }else if(num == 8){
                    this.qing_number = data.target.innerText;
                }else if(num == 9){
                    this.jie_num = data.target.innerText;
                }else if(num == 12){
                    this.an_jishu = data.target.innerText;
                }else if(num == 13){
                    this.an_fee = data.target.innerText;
                }
            },
            //修改编辑保存状态
            editor: function (ty, idx) {

                if (this.stus == 1) {
                    this.stus = 2;
                    if (ty == 1) {
                        this.$set(this.arrList.zhi_cai[idx], 'statusr', true);
                    } else if (ty == 2) {
                        this.$set(this.arrList.zhuan_cai[idx], 'statusr', true);
                    } else if (ty == 3) {
                        this.$set(this.arrList.zhi_ren[idx], 'statusr', true);
                    } else if (ty == 4) {
                        this.$set(this.arrList.zhuan_ren[idx], 'statusr', true);
                    } else if(ty == 5){
                        this.$set(this.arrList.zhi_jixie[idx], 'statusr', true);
                    }else if(ty == 6){
                        this.$set(this.arrList.zhuan_jixie[idx], 'statusr', true);
                    }
                } else {
                    layer.alert('请先保存');
                    return false;
                }
            },
            //修改数据
            saves: function (id, idx, ty) {
                var obj = {
                        id: id,
                        project_id: this.project_id
                    },
                    url = '';
                if (ty == 1) {
                    obj.status = 1;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhi_cai[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhi_cai[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhi_cai[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhi_cai[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhi_cai[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                } else if (ty == 2) {
                    obj.status = 2;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhuan_cai[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhuan_cai[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhuan_cai[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhuan_cai[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhuan_cai[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                } else if (ty == 3) {
                    obj.status = 1;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhi_ren[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhi_ren[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhi_ren[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhi_ren[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhi_ren[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                } else if (ty == 4) {
                    obj.status = 2;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhuan_ren[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhuan_ren[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhuan_ren[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhuan_ren[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhuan_ren[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                }else if(ty ==5){
                    obj.status = 1;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhi_jixie[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhi_jixie[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhi_jixie[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhi_jixie[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhi_jixie[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                }else if(ty == 6){
                    obj.status = 2;
                    if(vm.he_price == ''){
                        obj.he_price = vm.arrList.zhuan_jixie[idx].he_price;
                    }else{
                        obj.he_price = vm.he_price;
                    }
                    if(vm.jie_num == ''){
                        obj.jie_num = vm.arrList.zhuan_jixie[idx].jie_num;
                    }else{
                        obj.jie_num = vm.jie_num;
                    }
                    if(vm.qing_number == ''){
                        obj.qing_number = vm.arrList.zhuan_jixie[idx].qing_number;
                    }else{
                        obj.qing_number = vm.qing_number;
                    }
                    if(vm.an_jishu == ''){
                        obj.an_jishu = vm.arrList.zhuan_jixie[idx].an_jishu;
                    }else{
                        obj.an_jishu = vm.an_jishu;
                    }
                    if(vm.an_fee == ''){
                        obj.an_fee = vm.arrList.zhuan_jixie[idx].an_fee;
                    }else{
                        obj.an_fee = vm.an_fee;
                    }
                }
                var load = layer.load(2, {
                    shade: [0.6, '#fff'] //0.1透明度的白色背景
                })
                this.stus = 1;
                $.when(PUATTRBUTE.REQUESTFUN('api/Statistics/chanzhiedit', obj).done(function (res) {
                        layer.close(load);
                        if (res.code == 1) {
                            vm.he_price = '';
                            vm.jie_num = '';
                            vm.qing_number = '';
                            vm.an_jishu = '';
                            vm.an_fee = '';
                            vm.stus = 1;
                            layer.msg(res.msg, {time: 1000, icon: 1})
                            vm.initData();
                        } else {
                            layer.msg(res.msg, {time: 1000, icon: 2})
                        }
                    })
                )
            }
        },
    })
    layui.use(['form', 'laydate', 'jquery'], function () {
        var form = layui.form,
            laydate = layui.laydate;
    })
    //导出
    function exports() {
        if(vm.permissions == 1){
            layer.alert("抱歉，您没有此权限！")
        }else {
            var tableHtml = $('#searchCU');
            $(tableHtml).css({
                'border':'1px solid #d5d5d2',
                'text-align':'center',
                'border-collapse':'collapse',
            });
            $(tableHtml).find('tr td').css({
                'text-align':'center',
                'border':'1px solid #d5d5d2',
                'line-height':'30px',
                'padding':'0px 10px',
                'min-width':'100px'
            });
            var html = "<html><head><meta charset='utf-8' /></head><body>" + tableHtml[0].outerHTML + "</body></html>";
// 实例化一个Blob对象，其构造函数的第一个参数是包含文件内容的数组，第二个参数是包含文件类型属性的对象
            var blob = new Blob([html], { type: "application/vnd.ms-excel" });
            var urlA = document.createElement('a');
// 利用URL.createObjectURL()方法为a元素生成blob URL
            $('.table-btn-group').append(urlA);
            urlA.href = URL.createObjectURL(blob);
// 设置文件名，目前只有Chrome和FireFox支持此属性
            urlA.download = "产值计算表.xls";
            urlA.click();
        }
    }
</script>
</html>